const {
    Mysql,
    TripleEncrypt
} = require('../tools');
module.exports = async ctx => {
    let { uid ,openId} = ctx.query;
    if (!uid || !openId) {
        ctx.state.data = {
            code: '002',
            msg: '参数确实'
        }
        return;
    }
    else {
        let sql = `SELECT * FROM  orderList WHERE openId = '${openId}' ORDER BY create_time DESC LIMIT 20`;
        let res = await Mysql(sql);
        ctx.state.data = {
            code: '001',
            data: TripleEncrypt(JSON.stringify(res))
        }
    }
}